 

export function isNull(obj: any) {
    return obj == undefined || obj == null;
}

/**
 * 方向枚举
 */
export enum DIR {
    LEFT,
    RIGHT,
    UP,
    DOWN,
    NONE,
}

export let MOVE_DIR: number[] = [-1, 1, 1, -1]

/**
 * 未获得
 * 以获得
 * 可获得
 */
export enum ItemState {
    NOT_GET,
    GOT,
    CAN_GET,
}

//重力加速度
export let g: number = 1


export function logInfo(...val) {
    // console.log.apply(console, arguments);
}

export function logWarn(...val) {
    // console.warn.apply(console, arguments)
}
export function logError(...val) {
    // console.error.apply(console, arguments)
}

 


//ui分层
export enum UIIndex {
    ROOT,//最底层
    STACK,//堆栈管理
    QUEUE,//队列管理
    TOAST,//
    TOP,//永远不会清除的ui层
}


/**
 * 等于
 * 大于等于
 * 小于等于
 * 大于
 * 小于
 * 不等于
 */
export enum CompareSign {
    EQUAL,
    MORE_EQUAL,
    LESS_EQUAL,
    MORE,
    LESS,
    NOT_EQUAL
}

export function gameCompare(value, sign: CompareSign, num: number | string) {
    switch (sign) {
        case CompareSign.EQUAL:
            return value == num;
        case CompareSign.MORE_EQUAL:
            return value >= num;
        case CompareSign.MORE:
            return value > num;
        case CompareSign.LESS_EQUAL:
            return value <= num;
        case CompareSign.LESS:
            return value < num;
        case CompareSign.NOT_EQUAL:
            return value != num;
        default:
            return false;
    }
} 


/**
 * 评分
 */
export enum SCORE {
    MISS = 0,
    GOOD ,
    GREAT,
    PERFECT,
    DOUBLE_2,
    DOUBLE_3,
    DOUBLE_4,
    DOUBLE_5,
}

export enum SPINE_ACTION{
    ATTACK = "attack",
    ATTACK_FLY = "attack_fly",
    RUN = "run",
    RUN_FLY = "run_fly",
    WAIT = "wait", 
    WAIT_FLY = "wait_fly",
}


export enum FACE_DIR {
    LEFT = 1,
    RIGHT = -1
}